﻿{% extends "base.html" %}



{% block css %}
<link rel="stylesheet" href="/static/css/admin.css">
<link rel="stylesheet" href="/static/ztree3/css/bootstrapStyle/bootstrapStyle.css" type="text/css">


{% endblock %}


{% block center %}


<!--头部导航-->
<div class="panel panel-default center-top" style="min-width:1300px;">
  <div class="panel-body">
    <ol class="breadcrumb" style="margin-bottom: 0px;background-color: #FFFFFF;">
      <li><a href="/" style="color: #377CD8;">首页</a></li>
      <li><a href="javascript:;">发布管理</a></li>
      <li class="active">{{ title }}</li>
    </ol>
  </div>
</div>



<!--用户信息-->
<div class="panel panel-default center-top" style="min-width:1300px;">
  <div class="panel-heading">
      <div class="row" style="padding-top:5px;padding-left:10px;">
          <div class="col-sm-6">

              <a class="btn btn-sm btn-success" data-toggle="modal" data-target="#gitModal"> 添加代码 </a>

          </div>
      </div>

  </div>
  <div class="panel-body">


        <div style="margin-bottom: 10px;">

            <div class="col-sm-12">
                <table class="table table-hover table-bordered">
                  <thead>
                    <tr style="background-color: #f5f5f5;">

                      <th>Git 仓库</th>
                      <th>项目</th>
                      <th>描述</th>
                      <th>Git 地址</th>
                      <th>认证</th>
                      <th>操作</th>
                    </tr>
                  </thead>
                  <tbody>
                    {% for git in gitcode_obj %}
                    <tr name="tbody">
                      <td>{{ git.git_name }}</td>
                      <td>{{ git.project.project_name }}</td>
                      <td>{{ git.git_msg }}</td>
                      <td>{{ git.git_url }}</td>
                        {% if git.git_user and git.git_passwd or git.git_sshkey %}
                        <td><a href="javascript:;" style="text-decoration:none;" name="edit-git-user" git_id="{{ git.id }}" data-toggle="tooltip" data-placement="left" title="修改">已配置</a></td>
                        {% else %}
                        <td><a href="javascript:;" style="text-decoration:none;color: red" name="edit-git-user" git_id="{{ git.id }}" data-toggle="tooltip" data-placement="left" title="修改">未配置</a></td>
                        {% endif %}
                      <td style="padding-left:5px;">

                        <a href="javascript:;" style="text-decoration:none;" name="edit-git" git_id="{{ git.id }}" data-toggle="tooltip" data-placement="left" title="修改"><span class="fa fa-pencil"></span> </a>&nbsp;&nbsp;&nbsp;

                        <a href="javascript:;" style="text-decoration:none;" name="del-git" git_id="{{ git.id }}" data-toggle="tooltip" data-placement="right" title="删除"><span class="fa fa-trash"></span> </a>

                      </td>
                    </tr>
                  {% endfor %}

                  </tbody>
                </table>

                <div class="text-right" style="margin-top:-30px;padding-right:9%">
                  <ul class="pagination" id="pagination"></ul>
                </div>
                
            </div>

        </div>
  </div>
</div>


{% endblock %}


<!-- Modal -->
{% block modal %}

<div class="modal fade" id="gitModal" tabindex="-1" role="dialog" aria-labelledby="gitModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content" style="margin-top:135px;">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="gitModalLabel">添加站点</h4>
      </div>
      <div class="modal-body">

         <form>
          <div class="form-group">
            <label >Git仓库</label>
            <input  class="form-control"  placeholder="站点名称" id="git-name">
          </div>
          <div class="form-group">
            <label >描述</label>
            <input  class="form-control"  placeholder="站点描述" id="git-msg">
          </div>
          <div class="form-group">
            <label >项目</label>
              <select name="" id="git-project" class="form-control">
                  {% for project in project_obj %}
                  <option value="{{ project.id }}">{{ project.project_name }}</option>
                  {% endfor %}
              </select>
          </div>
          <div class="form-group">
            <label >Git地址</label>
            <input  class="form-control"  placeholder="站点地址" id="git-url">
          </div>

          <div class="form-group">
            <label >Git用户</label>
            <input  class="form-control"  placeholder="Git用户" id="git-user">
          </div>

          <div class="form-group">
            <label >Git密码</label>
            <input  class="form-control" type="password" placeholder="Git密码" id="git-passwd">
          </div>

          <div class="form-group">
            <label >ssh秘钥</label>
            <textarea  class="form-control"  placeholder="ssh秘钥" id="git-sshkey"></textarea>
          </div>

        </form>

      </div>
      <div class="modal-footer">

        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>

        <button type="button" class="btn btn-primary" id="sub-git">提交</button>

      </div>
    </div>
  </div>
</div>


<div class="modal fade" id="edit-gitModal" tabindex="-1" role="dialog" aria-labelledby="edit-gitModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content" style="margin-top:135px;">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="edit-gitModalLabel">修改站点</h4>
      </div>
      <div class="modal-body">

         <form>
          <div class="form-group" id="div-git-name">
            <label >Git仓库</label>
            <input  class="form-control"  placeholder="站点名称" id="edit-git-name">
          </div>
          <div class="form-group" id="div-git-msg">
            <label>描述</label>
            <input  class="form-control"  placeholder="站点描述" id="edit-git-msg">
          </div>
          <div class="form-group" id="div-git-project">
            <label >项目</label>
              <select name="" class="form-control" id="edit-git-project">
                  {% for project in project_obj %}
                  <option value="{{ project.id }}">{{ project.project_name }}</option>
                  {% endfor %}
              </select>
          </div>
          <div class="form-group" id="div-git-url">
            <label >Git地址</label>
            <input  class="form-control"  placeholder="站点地址" id="edit-git-url">
          </div>
          <div class="form-group">
            <label >Git用户</label>
            <input  class="form-control"  placeholder="Git用户" id="edit-git-user">
          </div>

          <div class="form-group">
            <label >Git密码</label>
            <input  class="form-control" type="password"  placeholder="Git密码" id="edit-git-passwd">
          </div>

          <div class="form-group">
                <label >ssh秘钥</label>
              <textarea  class="form-control"  placeholder="ssh秘钥" id="edit-git-sshkey"></textarea>
          </div>


        </form>

      </div>
      <div class="modal-footer">

        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>

        <button type="button" class="btn btn-primary" id="sub-edit-git">提交</button>

      </div>
    </div>
  </div>
</div>


{% endblock  %}

{% block js %}

    <script type="text/javascript" src="/static/js/code_v2.js"></script>

    <script type="text/javascript">



    </script>

{% endblock %}


